package com.yanqu.road.entity.union.cross;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.dto.CrossPatronsSkill;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

/**
 * 议事厅门客
 */
@FieldTypeAnnotation(tableName = "t_c_union_chamber")
public class CrossUnionChamberPatrons extends DataObject {

    @FieldTypeAnnotation(update = true, desc = "玩家ID", select = true)
    long userId;

    @FieldTypeAnnotation(desc = "门客ID")
    int patronsId;

    @FieldTypeAnnotation(desc = "技能列表")
    List<CrossPatronsSkill> skillList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "赚钱")
    BigInteger ability = BigInteger.ZERO;

    @FieldTypeAnnotation(desc = "等级")
    private int level;

    @FieldTypeAnnotation(desc = "精进等级")
    private int stageLv;

    @FieldTypeAnnotation(desc = "突破等级")
    private int breakLv;

    @FieldTypeAnnotation(desc = "皮肤")
    private int skinId;

    @FieldTypeAnnotation(desc = "晋升")
    private int promotionId;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getPatronsId() {
        return patronsId;
    }

    public void setPatronsId(int patronsId) {
        if(this.patronsId != patronsId) {
            this.patronsId = patronsId;
            setUpdateOption();
        }
    }

    public List<CrossPatronsSkill> getSkillList() {
        return skillList;
    }

    public String getSkillListStr(){
        StringBuffer strBuff = new StringBuffer();
        for (int i = 0; i < skillList.size(); i++) {
            CrossPatronsSkill skill = skillList.get(i);
            if(i > 0){
                strBuff.append(";");
            }
            strBuff.append(skill.getId());
            strBuff.append(",");
            strBuff.append(skill.getLv());
            strBuff.append(",");
            strBuff.append(skill.getType());
            strBuff.append(",");
            strBuff.append(skill.getSkinLv());
        }
        return strBuff.toString();
    }

    public void setSkillList(List<CrossPatronsSkill> skillList) {
        this.skillList = skillList;
        setUpdateOption();
    }

    public BigInteger getAbility() {
        return ability;
    }

    public void setAbility(BigInteger ability) {
        this.ability = ability;
        setUpdateOption();
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        if(this.level != level) {
            this.level = level;
            setUpdateOption();
        }
    }

    public int getStageLv() {
        return stageLv;
    }

    public void setStageLv(int stageLv) {
        if(this.stageLv != stageLv) {
            this.stageLv = stageLv;
            setUpdateOption();
        }
    }

    public int getBreakLv() {
        return breakLv;
    }

    public void setBreakLv(int breakLv) {
        if(this.breakLv != breakLv) {
            this.breakLv = breakLv;
            setUpdateOption();
        }
    }

    public int getSkinId() {
        return skinId;
    }

    public void setSkinId(int skinId) {
        if(this.skinId != skinId) {
            this.skinId = skinId;
            setUpdateOption();
        }
    }

    public int getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(int promotionId) {
        if(this.promotionId != promotionId) {
            this.promotionId = promotionId;
            setUpdateOption();
        }
    }
}
